// component/video/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    poster: {
      type: String,
      value: ''
    },
    url: {
      type: String,
      value: ''
    }
  },
  ready() {
  this.video = wx.createVideoContext('video', this)
  },
  /**
   * 组件的初始数据
   */
  data: {
  show: false
  },

  /**
   * 组件的方法列表
   */
  methods: {
    play () {
      this.triggerEvent('change', false)
      this.setData({
        show: true
      })
      this.video.play();
    },
    endPlay () {
      this.setData({show: false})
      this.video.stop()
      this.triggerEvent('change', true)
    }
  }
})
